package com.heima.job;

import com.heima.feigns.ApArticleClient;
import com.heima.model.common.dtos.ResponseResult;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class ArticleXXLJob {

    @Autowired
    private ApArticleClient articleClient;

    @XxlJob("computeHotArticleJob")
    public void calculationArticleScore() {
        // 使用Feign发起远程调用
        ResponseResult responseResult = articleClient.selectFiveDaysArticle();
        System.out.println("responseResult.getCode() = " + responseResult.getCode());
    }
}